<?php

define('KS_APP_NAME', 'wechat');
//追加__ROOT__解析方法----------------------------------------------------------------------------------------------------开始
define('IS_CGI', strpos(PHP_SAPI, 'cgi') === 0 ? 1 : 0);
if (IS_CGI) {
    //CGI/FASTCGI模式下
    $_temp = explode('.php', $_SERVER['PHP_SELF']);
    define('_PHP_FILE_', rtrim(str_replace($_SERVER['HTTP_HOST'], '', $_temp[0] . '.php'), '/'));
} else {
    define('_PHP_FILE_', rtrim($_SERVER['SCRIPT_NAME'], '/'));
}
if (!defined('__STATIC__')) {
    $_root = rtrim(dirname(_PHP_FILE_), '/');
    define('__STATIC__', (($_root == '/' || $_root == '\\') ? '' : $_root) . '/public/' . KS_APP_NAME.'/static');
}
//追加__ROOT__解析方法----------------------------------------------------------------------------------------------------结束
define('ROOT_PATH', __DIR__ . '/');
define('APP_PATH', ROOT_PATH . 'app/' . KS_APP_NAME . '/');
define('RUNTIME_PATH', ROOT_PATH . 'runtime/' . KS_APP_NAME . '/');
require ROOT_PATH . 'public/app.php';
